﻿@model Poco.Zone

@{
    ViewBag.Title = "DetailZone";
}

<script src=@Url.Content("~/Content/js/jquery.validate.min.js") type="text/javascript"></script>
<script src=@Url.Content("~/Content/js/jquery.validate.unobtrusive.min.js") type="text/javascript"></script>
<script src=@Url.Content("~/Content/js/jquery.unobtrusive-ajax.min.js") type="text/javascript"></script>

<h2>DetailZone</h2>

<fieldset>
    <legend>Zone</legend>

    <div class="display-label">Numero</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Numero)
    </div>

    <div class="display-label">Description</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Description)
    </div>

    <div class="display-label">Nom Restaurant</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Restaurant.Nom)
    </div>

    <div class="display-label">Serveur</div>
    <div class="display-label">@if (Model.Serveur != null) {@Model.Serveur.Prenom @Model.Serveur.Nom}else{<text>Pas de Serveur</text>}</div>
</fieldset>
<p>
    @Html.ActionLink("Editer", "EditerZone", new { id=Model.Id }) |
    @Html.ActionLink("Retour à la liste", "Index")
</p>


<fieldset>
    <legend>Zones</legend>

    @Html.Action("AjouterTable", "Restaurants", new { id = Model.Id })

    <table>
    @if (Model.Table.Count != 0)
    { 
  
        <tr>
            <th>
                Numero
            </th>
            <th>
                Nombre de Places
            </th>
            <th></th>
        </tr>
        
        foreach (var tab in Model.Table)
        {
            @Html.Partial("_Table", tab);
        }
        
        <tr id="nouvellesTables"></tr>
    }
    else
    {
     <td colspan=3>
        Aucunes Tables
     </td>    
    }
    </table>
</fieldset>